<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>translate.service - admin</title>
  <script src="./src/layui.js"></script>
  <link rel="stylesheet" href="./src/css/layui.css">
  <style>
    body{margin: 0;padding: 0px;height: 100%;overflow: hidden;}
    .layui-nav.layui-nav-tree {
      width: 150px;
      padding: 0;
    }
  </style>
  <script src="./translate.service.js"></script>

</head>
<body>
  <script>
    /*** 第一步，检测是否正确填写参数，先填写好相关参数才行 ***/
    var login = isLogin();
    if(login[0] == '0'){
      window.stop();
      msg.textarea(login[1],function(value){
        localStorage.setItem(login[2], value);
        location.reload();
      });
    }
  </script>  

<style>
#editPanel{
  position: absolute;
  top: 0px;
  width:150px;
}
#editPanel span{
  width:100%;
}

.menu{
  width:150px;
  height:100%;
  background-color: #393D49;
  position: absolute;
}
.menu ul li{
  cursor: pointer;
}

/*左侧的一级菜单的图标*/
.firstMenuIcon{
  font-size:16px;
  padding-right:8px;
  font-weight: 700;
}
/*左侧的一级菜单的文字描述*/
.firstMenuFont{
  
}

/* 二级菜单 */
.menu .layui-nav-item .layui-nav-child .subMenuItem{
  padding-left:48px;
  font-size: 13px;
}
</style>


<div id="leftMenu" class="layui-nav layui-nav-tree layui-nav-side menu">
  <ul class="">


    <div style="margin-left: 3px;">
      <li id="li_translate-text" class="layui-nav-item" >
        <a href="javascript:loadUrl('translate-text.html');">
          <i class="layui-icon firstMenuIcon">&#xe633;</i>
          <span class="firstMenuFont">译文微调</span>
        </a>
      </li>
    </div>
    <div style="margin-left: 3px;">
      <li id="li_domainList" class="layui-nav-item" >
        <a href="javascript:loadUrl('domainList.html');">
          <i class="layui-icon firstMenuIcon">&#xe7ae;</i>
          <span class="firstMenuFont">域名管理</span>
        </a>
      </li>
    </div>
    <div style="margin-left: 3px;">
      <li id="li_balanceManage" class="layui-nav-item" >
        <a href="javascript:loadUrl('balanceManage.html');">
          <i class="layui-icon firstMenuIcon">&#xe65e;</i>
          <span class="firstMenuFont">余额管理</span>
        </a>
      </li>
    </div>
    <div style="margin-left: 3px;">
      <li id="li_installSsl" class="layui-nav-item" >
        <a href="javascript:loadUrl('installSsl.html');">
          <i class="layui-icon firstMenuIcon">&#xe62a;</i>
          <span class="firstMenuFont">安装SSL</span>
        </a>
      </li>
    </div>




    
    
    
    <li id="powerMenuItem" class="layui-nav-item ignore" style="position: absolute;bottom: 0px; text-align:center;">
      <a href="http://translate.zvo.cn" target="_black">
        <span class="firstMenuFont" style="font-size:0.6rem;">translate.js 翻译服务</span>
      </a>
    </li>
    
  </ul>
</div>


<div id="content" style="width: calc(100% - 150px);height:100%;position: absolute;left: 150px;word-wrap: break-word;box-sizing: border-box;">
  <iframe name="iframe" id="iframe" frameborder="0" style="width:100%;height:100%;box-sizing: border-box;"></iframe>
</div>

<script>
layui.use('element', function(){
  var element = layui.element;
});

//退出登录
function logout(){
  msg.loading('退出中..');
  wm.post('/logout.json',{}, function(data){
    msg.success('已退出', function(){
       window.location.href="/login.do";
    });
  });
}

/**
 * 在主体内容区域iframe中加载制定的页面
 * url 要加载的页面的url
 */
function loadUrl(url){
  if(url.indexOf('/user/logout.do') > 0){
    //兼容2.1及以前版本
    logout();
    return;
  }
  document.getElementById("iframe").src=url;
}

//加载登录后的默认页面
loadUrl('translate-text.html');



</script>

</body>
</html>